Skip to main content

Adding Edge Compute

You can configure multiple edge compute functions within your service. Each function is associated with a list of routes, where each route consists of a domain and a path pattern.

To add an edge compute function to your service:

  1. Navigate to your service.

  2. In the sidebar, select Edge Compute.

  3. Click the New button.

  4. Fill in the new edge compute form:

    • Name – Enter a name for the new edge compute function.
    • Stages – Select the stage or stages of the request flow where the code should run:
      • On Request – Triggered when the incoming HTTP request reaches the edge.
      • On Response – Triggered after a response is generated but before it is returned to the end user.
    • Code – Provide the code you want to deploy. For more details, review the Developer Guide.
    • Add Route – Specify the routes (domain + path pattern) where the function should apply. Examples:
      • a.example.com/api/* – Applies the code to all requests under the domain a.example.com matching the path pattern /api/*.
      • */blogs/* – Applies the code to all service domains for requests matching the path pattern /blogs/*.

Once created, the new edge compute function will appear in the list, and take affect immediately.